package com.atguigu.gmall.order.vo;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author lzw
 * @Description
 * @create 2025年6月5日 15:05:53
 */
@NoArgsConstructor
@Data
public class OrderSubmitVo {

    //收货人
    @NotBlank(message = "收货人不能为空")  // @NotNull + 不能是空串
    private String consignee;

    //电话  555 5555 -  15
    @Length(min = 5,max = 15,message = "电话号码不正确")
    @NotBlank(message = "电话不能为空")
    private String consigneeTel;

    //配送地址
    @NotBlank(message = "配送地址不能为空")
    private String deliveryAddress;

    //订单备注
    private String orderComment;

    //订单明细
    private List<OrderDetailListDTO> orderDetailList;

    @NotBlank(message = "支付方式不能为空")
    private String paymentWay = "online";

    @NoArgsConstructor
    @Data
    public static class OrderDetailListDTO {

        @NotBlank(message = "图片地址不能为空")
        private String imgUrl;

        @NotBlank(message = "商品名不能为空")
        private String skuName;

        @NotBlank(message = "订单价格不能为空")
        private BigDecimal orderPrice;

        @NotBlank(message = "商品数量不能为空")
        private Integer skuNum;

        @NotBlank(message = "商品id不能为空")
        private Long skuId;

        private String hasStock;
    }
}
